package com.xms.datacore.provider;

import com.xms.datacore.SqlDescriptor;
import org.apache.ibatis.session.SqlSession;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 * IDataBase
 * </p>
 *
 * @author migo
 * @since 2021/8/31
 */
public interface IDataBase {
    SqlSession getSqlSession();
    void closeSqlSession(SqlSession session);
    boolean execute(SqlDescriptor sql) throws SQLException;
    boolean execute(String sql) throws SQLException;
    boolean execute(SqlSession session, SqlDescriptor sql) throws SQLException;
    boolean execute(SqlSession session, String sql) throws SQLException;
    ResultSet executeQuery(SqlDescriptor sql) throws SQLException;
    ResultSet executeQuery(String sql) throws SQLException;
    List<ResultSet> executeMultiQuery(SqlDescriptor... sqls) throws SQLException;
    ResultSet executeQuery(SqlSession session, SqlDescriptor sql) throws SQLException;
    ResultSet executeQuery(SqlSession session, String sql) throws SQLException;
    List<ResultSet> executeMultiQuery(SqlSession session, SqlDescriptor... sqls) throws SQLException;
}
